<%@tag import="java.sql.Connection"%>
<%@ attribute name="team" required="true" type="by.epam.communalservices.entity.JkhTeam"%>
<%@ attribute name="dif"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib tagdir="/WEB-INF/tags/connect" prefix="connect"%>
<%@ taglib tagdir="/WEB-INF/tags/team" prefix="team"%>
<%@ taglib tagdir="/WEB-INF/tags/user" prefix="user"%>



<c:set var="link" value='"team_edit?id=${team.id}"' />
<c:set var="click" value=" onclick='document.location.href=${link}' style='cursor:hand;'" />

<tr id="${dif}"
	onmouseover="this.backup=this.style.backgroundColor;this.style.backgroundColor='red';"
	onmouseout="this.style.backgroundColor=this.backup;" >
	<td ${click}><c:out value="${team.id}" /></td>
	<td ${click}><c:out value="${team.name}" /></td>
	<td ${click}><c:out value="${team.surname}" /></td>
	<td ${click}><c:out value="${team.patronymic}" /></td>
	<td ${click}><team:count id="${team.id}" /></td>
	<td ${click}><user:name id="${team.idOwner}" /></td>
	<td ${click}><team:status id="${team.id}" status="1" /></td>
	<td ${click}><team:status id="${team.id}" status="3" />/<team:status id="${team.id}" status="2" /></td>
	<td id='l'>
		<connect:display rules="admin,view,team_view,kadrovik">
			<button type="button"
				onclick="document.location.href='team_edit?id=${team.id}'">edit</button>
			<button type="button"
				onclick="if (confirm('Уверены?')) document.location.href='team_edit?delete=${team.id}'"
				style="color: red;">delete</button>
		</connect:display>
		<connect:display rules="brigadir">
			<button type="button"
				onclick="document.location.href='team_edit?id=${team.id}'">view</button>
		</connect:display>
	</td>
</tr>